package com.apexsoft.front.common.utils;

import java.sql.Blob;
import java.sql.Clob;
import java.util.Date;

public class OracleClassUtil 
{
	public static ClassMapping[] classMapping = {
		//oracle
		new ClassMapping("NUMBER",		new Class[]{int.class},			"getInt"),
		new ClassMapping("LONG",		new Class[]{float.class},		"getFloat"),
		new ClassMapping("CHAR",		new Class[]{String.class},		"getString"),
		new ClassMapping("VARCHAR2",	new Class[]{String.class},		"getString"),
		new ClassMapping("NVARCHAR2",	new Class[]{String.class},		"getString"),
		new ClassMapping("BLOB",		new Class[]{Blob.class},		"getBlob"),
		new ClassMapping("CLOB",		new Class[]{Clob.class},		"getClob"),
		new ClassMapping("DATE",		new Class[]{Date.class},		"getDate")
		
	};
	
	//获取映射关系
	public static ClassMapping getColumnClassMapping(String columnTypeName)
	{
		for(ClassMapping mapping:classMapping)
		{
			if(columnTypeName.equals(mapping.getTypeName()))
				return mapping;
		}
		return new ClassMapping("VARCHAR",new Class[]{String.class},"getString");
	}

}
